<?php

namespace App\Http\Requests\Mini\Estate;

use Illuminate\Foundation\Http\FormRequest;

class PayRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules(): array
    {
        return [
            'fee_type' => 'required|digits:1',
            'type' => 'required|digits:1',
            'paymentMoney' => 'required|numeric|min:0|not_in:0',
            'pay_type' => 'required|digits:1',
            'device_type' => 'required|digits:1',
        ];
    }

    /**
     * Notes: 提示信息
     * User: lstink
     * Date: 2021/3/17
     * Time: 2:39 下午
     * @return string[]
     */
    public function messages(): array
    {
        return [
            'fee_type.required' => '请传递费用类型',
            'fee_type.integer' => '费用类型必须为数字',
            'fee_type.digits' => '费用类型必须为数字,且最大长度为1',
            'type.required' => '请传递缴费类型',
            'paymentMoney.required' => '请传递缴费金额',
            'paymentMoney.numeric' => '缴费金额必须为数字',
            'paymentMoney.min' => '缴费金额不能是负数',
            'paymentMoney.not_in' => '缴费金额必须大于0',
            'pay_type.required' => '请传递支付方式',
            'pay_type.digits' => '支付方式必须为数字，且最大长度为1',
            'device_type.required' => '设备类型不能为空',
            'device_type.digits' => '设备类型必须为数字,且最大长度为1',
        ];
    }
}
